<?php
class Model_Xml
{
	/**
	 * Get all the  nodes 
	 * @return ArrayObject
	 */
	public static function getAllNodes($path)
	{
		$f_xml = null;
		if (file_exists($path)) {
        	$f_xml = simplexml_load_file($path);
        	
    	}
    	$controllers = $f_xml->children();
    	
		$resourceListItems = null;
    	foreach($controllers as $controller){
    		$controllerName = (string)$controller->attributes()->name;
    		$controllerActions = $controller->children();
    		 if (count($controllerActions) > 0) {
    		 	
    		 	foreach ($controllerActions as $action) {
    		 		$actionName = (string)$action;
    		 		$resourceListItems[$controllerName][] = $actionName;
    		 	}
    		 }else{
    		 	$resourceListItems[$controllerName] = null;
    		 }
    	}
    	
    	return $resourceListItems;
	}
}